package net.zdreamer.geracomium.entity;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class DateGirdInfos implements Serializable {
    public List<DateGirdInfo> dategirdinfos = new ArrayList<DateGirdInfos.DateGirdInfo>();
    SimpleDateFormat format;

    public DateGirdInfos() {
        super();

        Date now = new Date();
        format = new SimpleDateFormat("MM.dd");
        //  dategirdinfo.date = format.format(now);
        // dategirdinfos.add(dategirdinfo);
        for (int i = 0; i < 5; i++) {
            DateGirdInfo dategirdinfo = new DateGirdInfo();
            dategirdinfo.date = getdate(i);
            dategirdinfos.add(dategirdinfo);
        }


    }

    private String getdate(int data) {
        Calendar cal = Calendar.getInstance();

        cal.setTime(new Date());
        cal.add(Calendar.DAY_OF_MONTH, data);  //第2天，第x天，照加。如果是负数，表示前n天。

        Date tomorrow = cal.getTime();
        return format.format(tomorrow);
    }


    public class DateGirdInfo {
        public String date;
    }
}
